/*
 * Ant Group
 * Copyright (c) 2004-2021 All Rights Reserved.
 */
package com.mashibing.tank;

import java.awt.*;

/**
 * @author zhouzheng
 * @version Bullet.java, v 0.1 2021年08月20日 5:22 下午 zhouzheng
 */
public class Explode {
    public static final int WIDTH  = ResourceMgr.explodes[0].getWidth();
    public static final int HEIGHT = ResourceMgr.explodes[0].getHeight();
    private             int x, y;
    private TankFrame tf     = null;
    private int       step   = 0;

    public Explode(int x, int y, TankFrame tf) {
        this.x = x;
        this.y = y;
        this.tf = tf;
    }

    public void paint(Graphics g) {
        g.drawImage(ResourceMgr.explodes[step++],x,y,null);
        if (step >= ResourceMgr.explodes.length)
            tf.explodes.remove(this);
    }

}